| Go Application is a built-in template that is used each time you create a new Go file. In
comparison
with the Go File template, Go Application has a predefined main function. To use this template,
navigate to File | New, select Go File in the Go category, and click Simple Application. The template is editable. In a template, you can use predefined variables that are listed below. These variables expand into corresponding values later in the editor. It is also possible to specify custom variables. Custom variables use the following format: ${VARIABLE_NAME}, where
VARIABLE_NAME is a name for your variable (for example, ${MY_CUSTOM_FUNCTION_NAME}).
Before the IDE creates a new file with custom variables, you see a dialog where you can define values for custom variables in the
template.By using the #parse directive, you can include templates from the Includes tab. To include a template,
specify the full name of the template as a parameter in quotation marks (for example, #parse("File Header")).
|
| List of predefined variables | ||
|
|
Name of the package where a new test file is created. The file must have
the _test postfix. The name has the
following format: package_test. |
|
|
|
Name of the package in which a new file is created. | |
|
|
Current system date. | |
|
|
Current day of the month. | |
|
|
First three letters of the current day name (for example, Mon, Tue, and
so on). |
|
|
|
Full name of the current day (for example, Monday, Tuesday, and so on). |
|
|
|
Path to the directory of the new file. This path is relative to the project root. | |
|
|
Dollar sign ($). This variable is used to escape the dollar character, so that it is not treated as a prefix of a template variable. | |
|
|
Name of the new file. | |
|
|
Current hour. | |
|
|
Current minute. | |
|
|
Current second. | |
|
|
Current month. | |
|
|
The first 3 letters of the current month name (for example, Jan, Feb, and
so on).
|
|
|
|
Full name of the current month (for example, January, February, and so
on).
|
|
|
|
Name of the new entity: a file, a type, an interface, and so on. | |
|
|
Name of the IDE. | |
|
|
Name of the current project. | |
|
|
Current system time. | |
|
|
System login name of the current user. | |
|
|
Current year. | |